package com.itheima.mapper;

import com.itheima.pojo.Clazz;
import com.itheima.pojo.ClazzQueryParam;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;


import java.util.List;

@Mapper
public interface ClazzMapper {

    List<Clazz> page(ClazzQueryParam clazzQueryParam);
    @Select("insert into web01.clazz ( name, room, begin_date, end_date, master_id, subject) values(#{name},#{room},#{beginDate},#{endDate},#{masterId},#{subject})")
    void insert(Clazz clazz);
    @Delete("delete from web01.clazz where id = #{id}")
    void delete(Integer id);
    @Select("select  * from web01.clazz where id = #{id}")
    Clazz getById(Integer id);

    void updateById(Clazz clazz);
@Select("SELECT  * FROM web01.clazz ")
    List<Clazz> list();
}
